/* GUI CONVERTED from rcsoisk3.p (converter v1.75) Tue Apr 10 12:05:55 2001 */
/* rcsoisk3.p - Shipper Confirmation Process Kit - Transactions               */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                        */
/* All rights reserved worldwide.  This is an unpublished work.               */
/* $Revision: 1.6.1.4 $                                                       */
/*V8:ConvertMode=Maintenance                                                  */
/* REVISION: 8.6      LAST MODIFIED: 10/18/96   BY: *K003* Forrest Mori       */
/* REVISION: 8.6      LAST MODIFIED: 12/03/96   BY: *K022* Kieu Nguyen        */
/* REVISION: 8.6      LAST MODIFIED: 11/04/97   BY: *K15N* Jim Williams       */
/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane          */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan         */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan         */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* Mark Brown         */
/* $Revision: 1.6.1.4 $  BY: Jean Miller      DATE: 03/22/01   ECO: *P008*    */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/
{mfdeclre.i}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rcsoisk3_p_1 "Effective"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/* INPUT VARIABLES */
define input parameter confirm_mode like mfc_logical no-undo.
define input parameter sodnbr  like sod_nbr no-undo.
define input parameter sodline like sod_line no-undo.
define input parameter srline  like sr_lineid no-undo.
define input parameter srsite  like sr_site no-undo.
define input parameter srloc   like sr_loc no-undo.
define input parameter srlot   like sr_lotser no-undo.
define input parameter srref   like sr_ref no-undo.
define input parameter srqty   like sr_qty no-undo.

/* SHARED VARIABLES */
define new shared variable wo_recno as recid.
define new shared variable wolot like tr_lot.
define     shared variable qty_iss_rcv like tr_qty_loc.
define     shared variable accum_wip like tr_gl_amt.
define     shared variable eff_date like glt_effdate label {&rcsoisk3_p_1}.
define     shared variable sod_recno as recid.
define     shared variable ship_dt like so_ship_date.

find sod_det where sod_nbr = sodnbr and sod_line = sodline no-error.

/* CREATE sr_wkfl FOR THE KIT PARENT */
find sr_wkfl where
   sr_userid = mfguser and
   sr_lineid = srline and
   sr_site = srsite and
   sr_loc = srloc and
   sr_lotser = srlot and
   sr_ref = srref
exclusive-lock no-error.

if not available sr_wkfl then do:
   create sr_wkfl.
   assign
      sr_userid = mfguser
      sr_lineid = srline
      sr_site = srsite
      sr_loc = srloc
      sr_lotser = srlot
      sr_ref = srref.
end.

if recid(sr_wkfl) = -1 then.

if confirm_mode then
assign
   sr_qty = srqty / sod_um_conv
   sod_qty_chg = srqty / sod_um_conv.
else
assign
   sr_qty = - srqty / sod_um_conv
   sod_qty_chg = - srqty / sod_um_conv.

{mfnxtsq.i wo_mstr wo_lot woc_sq01 wolot}

sod_recno = recid(sod_det).

accum_wip = 0.

/* ISSUE COMPONENTS (ISS-FAS) */
{gprun.i ""soise03.p"" "(input sod_nbr, input sod_line)" }
/*GUI*/ if global-beam-me-up then undo, leave.


/* PROCESS PARENT RECEIPT (RCT-FAS) AND CREATE VARIANCES */
{gprun.i ""soise04.p"" "(input sod_nbr, input sod_line)" }
/*GUI*/ if global-beam-me-up then undo, leave.


/* CLEAR sr_wkfl */
for each sr_wkfl where
      sr_userid = mfguser and
      sr_lineid begins srline
exclusive-lock:
   delete sr_wkfl.
end.
